<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Budget\InfoController;
use App\Http\Controllers\Auth\LoginController;
use App\Http\Controllers\Auth\HomeController;
use App\Http\Controllers\Auth\IndexController;
use App\Http\Controllers\Reality\ViewsController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('list', InfoController::class)->middleware('auth');


Route::prefix('auth')->name('auth.')->group(function (){
      Route::any('login',LoginController::class)->name('login')->middleware('web');
      Route::any('home',HomeController::class)->name('home')->middleware('web');
      Route::any('index',IndexController::class)->name('index');
});

//实际收支
Route::prefix('reality')->name('reality.')->group(function(){
    Route::resource('views',ViewsController::class);
});
//预计收支
Route::prefix('budget')->name('budget.')->group(function(){
    Route::resource('views',App\Http\Controllers\Budget\ViewsController::class);
});
